/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package twitterdb;

import dao.HistoricDao;
import dao.TweetDao;
import dao.UserDao;
import entity.Historic;
import entity.Tweet;
import entity.User;

/**
 *
 * @author AnBoCa
 */
public class TwitterDB {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        UserDao userDao=new UserDao();
        User user=new User();
        user.setName("pepito");
        user.setID(new Long(1));
        user.setPassword("pass");
        user.setUserName("pepito01");
        user.setEmail("pepito@pepito.com");
        userDao.insert(user);
        TweetDao tweetDao=new TweetDao();
        Tweet tweet=new Tweet();
        tweet.setAuthorID(new Long(1));
        tweet.setAuthorName("pepito");
        tweet.setDate(new Long(15072012));
        tweet.setText("140 caracteres");
        tweetDao.insert(tweet, null, null);
        HistoricDao historicDao=new HistoricDao();
        Historic historic=new Historic();
        historic.setDate(new Long(15072012));
        historicDao.insert(historic);
        System.out.println("User: "+userDao.findUsuarioByID(new Long(1)).getName());
    }
}
